import { ipcMain } from 'electron';
import { translateYoudao } from './youdao'

export function register () {
  ipcMain.handle('translate', (
    _event,
    text: string,
    source?: string,
    target?: string,
  ) => {
    return translateYoudao(text, source, target)
  })
}
